Utility = {
	createElement:function(tag, attr, style, e, parent, insertBefore, addEventNew){
		var element = document.createElement(tag);
		if(attr){
			Utility.setAttr(element, attr);
		}
		if(style){
			Utility.setAttr(element.style, style);
		}
		if(e){
			if(addEventNew){
				Utility.addEventHandler(element, e);
			}else{
				Utility.addEvent(element, e);
			}
		}
		if(parent){
			if(insertBefore){
				parent.insertBefore(element, insertBefore);
			}else{
				parent.appendChild(element);
			}
		}
		return element;
	},
	setAttr:function(element, attr, nested){
		for(var name in attr){
			if(typeof attr[name] == "object" && !nested){
				return;
			}
			element[name] = attr[name];
		}
	},
	addEvent:function(element, e){
		for(var name in e){
			element[name] = e[name];
		}
	},
	addEventHandler:function(element, e, useCapture){
		for(var name in e){
			if(element.addEventListener){
				element.addEventListener(name, e[name], useCapture);
			}else{
				element.attachEvent("on" + name, e[name]);
				if(useCapture){
					element.setCapture(true);
				}
			}
		}
	},
	removeEventHandler:function(element, e, useCapture){
		for(var name in e){
			element.removeEventListener(name, e[name], useCapture);
		}
	},
	exist:function(obj){
		return obj || obj == 0;
	}
};